<?php
$tdatacompany_address=array();
	$tdatacompany_address[".NumberOfChars"]=80; 
	$tdatacompany_address[".ShortName"]="company_address";
	$tdatacompany_address[".OwnerID"]="";
	$tdatacompany_address[".OriginalTable"]="contacts";


	
//	field labels
$fieldLabelscompany_address = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelscompany_address["English"]=array();
	$fieldToolTipscompany_address["English"]=array();
	$fieldLabelscompany_address["English"]["id"] = "Id";
	$fieldToolTipscompany_address["English"]["id"] = "";
	$fieldLabelscompany_address["English"]["company_id"] = "Company";
	$fieldToolTipscompany_address["English"]["company_id"] = "";
	$fieldLabelscompany_address["English"]["address"] = "Address";
	$fieldToolTipscompany_address["English"]["address"] = "";
	$fieldLabelscompany_address["English"]["city_id"] = "City ";
	$fieldToolTipscompany_address["English"]["city_id"] = "";
	$fieldLabelscompany_address["English"]["port_id"] = "Port ";
	$fieldToolTipscompany_address["English"]["port_id"] = "";
	$fieldLabelscompany_address["English"]["phone1"] = "Phone 1";
	$fieldToolTipscompany_address["English"]["phone1"] = "";
	$fieldLabelscompany_address["English"]["phone2"] = "Phone 2";
	$fieldToolTipscompany_address["English"]["phone2"] = "";
	$fieldLabelscompany_address["English"]["fax1"] = "Fax 1";
	$fieldToolTipscompany_address["English"]["fax1"] = "";
	$fieldLabelscompany_address["English"]["fax2"] = "Fax 2";
	$fieldToolTipscompany_address["English"]["fax2"] = "";
	$fieldLabelscompany_address["English"]["email"] = "Email";
	$fieldToolTipscompany_address["English"]["email"] = "";
	$fieldLabelscompany_address["English"]["website"] = "Website";
	$fieldToolTipscompany_address["English"]["website"] = "";
	$fieldLabelscompany_address["English"]["primary"] = "Primary";
	$fieldToolTipscompany_address["English"]["primary"] = "";
	$fieldLabelscompany_address["English"]["company_name"] = "Company Name";
	$fieldToolTipscompany_address["English"]["company_name"] = "";
	$fieldLabelscompany_address["English"]["city_name"] = "City Name";
	$fieldToolTipscompany_address["English"]["city_name"] = "";
	$fieldLabelscompany_address["English"]["port_name"] = "Port Name";
	$fieldToolTipscompany_address["English"]["port_name"] = "";
	$fieldLabelscompany_address["English"]["state_name"] = "State Name";
	$fieldToolTipscompany_address["English"]["state_name"] = "";
	$fieldLabelscompany_address["English"]["state_code"] = "State Code";
	$fieldToolTipscompany_address["English"]["state_code"] = "";
	$fieldLabelscompany_address["English"]["city_code"] = "City Code";
	$fieldToolTipscompany_address["English"]["city_code"] = "";
	$fieldLabelscompany_address["English"]["country_code"] = "Country Code";
	$fieldToolTipscompany_address["English"]["country_code"] = "";
	$fieldLabelscompany_address["English"]["country_name"] = "Country Name";
	$fieldToolTipscompany_address["English"]["country_name"] = "";
	$fieldLabelscompany_address["English"]["full_addr"] = "Full Addr";
	$fieldToolTipscompany_address["English"]["full_addr"] = "";
	$fieldLabelscompany_address["English"]["other_addr"] = "Other Addr";
	$fieldToolTipscompany_address["English"]["other_addr"] = "";
	$fieldLabelscompany_address["English"]["pin_code"] = "Pin Code";
	$fieldToolTipscompany_address["English"]["pin_code"] = "";
	if (count($fieldToolTipscompany_address["English"])){
		$tdatacompany_address[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Hong Kong S.A.R.)")
{
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["id"] = "Id";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["id"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["company_id"] = "Company Id";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["company_id"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["address"] = "Address";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["address"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["city_id"] = "City Id";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["city_id"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["port_id"] = "Port Id";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["port_id"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["phone1"] = "Phone1";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["phone1"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["phone2"] = "Phone2";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["phone2"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["fax1"] = "Fax1";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["fax1"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["fax2"] = "Fax2";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["fax2"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["email"] = "Email";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["email"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["website"] = "Website";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["website"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["primary"] = "Primary";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["primary"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["company_name"] = "Company Name";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["company_name"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["city_name"] = "City Name";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["city_name"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["port_name"] = "Port Name";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["port_name"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["state_name"] = "State Name";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["state_name"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["state_code"] = "State Code";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["state_code"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["city_code"] = "City Code";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["city_code"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["country_code"] = "Country Code";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["country_code"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["country_name"] = "Country Name";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["country_name"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["full_addr"] = "Full Addr";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["full_addr"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["other_addr"] = "Other Addr";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["other_addr"] = "";
	$fieldLabelscompany_address["Chinese (Hong Kong S.A.R.)"]["pin_code"] = "Pin Code";
	$fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"]["pin_code"] = "";
	if (count($fieldToolTipscompany_address["Chinese (Hong Kong S.A.R.)"])){
		$tdatacompany_address[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Taiwan)")
{
	$fieldLabelscompany_address["Chinese (Taiwan)"]=array();
	$fieldToolTipscompany_address["Chinese (Taiwan)"]=array();
	$fieldLabelscompany_address["Chinese (Taiwan)"]["id"] = "Id";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["id"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["company_id"] = "Company Id";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["company_id"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["address"] = "Address";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["address"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["city_id"] = "City Id";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["city_id"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["port_id"] = "Port Id";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["port_id"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["phone1"] = "Phone1";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["phone1"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["phone2"] = "Phone2";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["phone2"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["fax1"] = "Fax1";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["fax1"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["fax2"] = "Fax2";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["fax2"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["email"] = "Email";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["email"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["website"] = "Website";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["website"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["primary"] = "Primary";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["primary"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["company_name"] = "Company Name";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["company_name"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["city_name"] = "City Name";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["city_name"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["port_name"] = "Port Name";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["port_name"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["state_name"] = "State Name";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["state_name"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["state_code"] = "State Code";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["state_code"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["city_code"] = "City Code";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["city_code"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["country_code"] = "Country Code";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["country_code"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["country_name"] = "Country Name";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["country_name"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["full_addr"] = "Full Addr";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["full_addr"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["other_addr"] = "Other Addr";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["other_addr"] = "";
	$fieldLabelscompany_address["Chinese (Taiwan)"]["pin_code"] = "Pin Code";
	$fieldToolTipscompany_address["Chinese (Taiwan)"]["pin_code"] = "";
	if (count($fieldToolTipscompany_address["Chinese (Taiwan)"])){
		$tdatacompany_address[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="French")
{
	$fieldLabelscompany_address["French"]=array();
	$fieldToolTipscompany_address["French"]=array();
	$fieldLabelscompany_address["French"]["id"] = "Id";
	$fieldToolTipscompany_address["French"]["id"] = "";
	$fieldLabelscompany_address["French"]["company_id"] = "Company Id";
	$fieldToolTipscompany_address["French"]["company_id"] = "";
	$fieldLabelscompany_address["French"]["address"] = "Address";
	$fieldToolTipscompany_address["French"]["address"] = "";
	$fieldLabelscompany_address["French"]["city_id"] = "City Id";
	$fieldToolTipscompany_address["French"]["city_id"] = "";
	$fieldLabelscompany_address["French"]["port_id"] = "Port Id";
	$fieldToolTipscompany_address["French"]["port_id"] = "";
	$fieldLabelscompany_address["French"]["phone1"] = "Phone1";
	$fieldToolTipscompany_address["French"]["phone1"] = "";
	$fieldLabelscompany_address["French"]["phone2"] = "Phone2";
	$fieldToolTipscompany_address["French"]["phone2"] = "";
	$fieldLabelscompany_address["French"]["fax1"] = "Fax1";
	$fieldToolTipscompany_address["French"]["fax1"] = "";
	$fieldLabelscompany_address["French"]["fax2"] = "Fax2";
	$fieldToolTipscompany_address["French"]["fax2"] = "";
	$fieldLabelscompany_address["French"]["email"] = "Email";
	$fieldToolTipscompany_address["French"]["email"] = "";
	$fieldLabelscompany_address["French"]["website"] = "Website";
	$fieldToolTipscompany_address["French"]["website"] = "";
	$fieldLabelscompany_address["French"]["primary"] = "Primary";
	$fieldToolTipscompany_address["French"]["primary"] = "";
	$fieldLabelscompany_address["French"]["company_name"] = "Company Name";
	$fieldToolTipscompany_address["French"]["company_name"] = "";
	$fieldLabelscompany_address["French"]["city_name"] = "City Name";
	$fieldToolTipscompany_address["French"]["city_name"] = "";
	$fieldLabelscompany_address["French"]["port_name"] = "Port Name";
	$fieldToolTipscompany_address["French"]["port_name"] = "";
	$fieldLabelscompany_address["French"]["state_name"] = "State Name";
	$fieldToolTipscompany_address["French"]["state_name"] = "";
	$fieldLabelscompany_address["French"]["state_code"] = "State Code";
	$fieldToolTipscompany_address["French"]["state_code"] = "";
	$fieldLabelscompany_address["French"]["city_code"] = "City Code";
	$fieldToolTipscompany_address["French"]["city_code"] = "";
	$fieldLabelscompany_address["French"]["country_code"] = "Country Code";
	$fieldToolTipscompany_address["French"]["country_code"] = "";
	$fieldLabelscompany_address["French"]["country_name"] = "Country Name";
	$fieldToolTipscompany_address["French"]["country_name"] = "";
	$fieldLabelscompany_address["French"]["full_addr"] = "Full Addr";
	$fieldToolTipscompany_address["French"]["full_addr"] = "";
	$fieldLabelscompany_address["French"]["other_addr"] = "Other Addr";
	$fieldToolTipscompany_address["French"]["other_addr"] = "";
	$fieldLabelscompany_address["French"]["pin_code"] = "Pin Code";
	$fieldToolTipscompany_address["French"]["pin_code"] = "";
	if (count($fieldToolTipscompany_address["French"])){
		$tdatacompany_address[".isUseToolTips"]=true;
	}
}


	
	$tdatacompany_address[".NCSearch"]=true;

	

$tdatacompany_address[".shortTableName"] = "company_address";
$tdatacompany_address[".nSecOptions"] = 0;
$tdatacompany_address[".recsPerRowList"] = 1;	
$tdatacompany_address[".tableGroupBy"] = "0";
$tdatacompany_address[".mainTableOwnerID"] = "";
$tdatacompany_address[".moveNext"] = 1;




$tdatacompany_address[".showAddInPopup"] = false;

$tdatacompany_address[".showEditInPopup"] = false;

$tdatacompany_address[".showViewInPopup"] = false;


$tdatacompany_address[".fieldsForRegister"] = array();

$tdatacompany_address[".listAjax"] = false;

	$tdatacompany_address[".audit"] = false;

	$tdatacompany_address[".locking"] = false;
	
$tdatacompany_address[".listIcons"] = true;
$tdatacompany_address[".edit"] = true;
$tdatacompany_address[".inlineEdit"] = true;
$tdatacompany_address[".view"] = true;

$tdatacompany_address[".exportTo"] = true;

$tdatacompany_address[".printFriendly"] = true;

$tdatacompany_address[".delete"] = true;

$tdatacompany_address[".showSimpleSearchOptions"] = false;

$tdatacompany_address[".showSearchPanel"] = true;


$tdatacompany_address[".isUseAjaxSuggest"] = true;

$tdatacompany_address[".rowHighlite"] = true;


// button handlers file names

$tdatacompany_address[".addPageEvents"] = false;

$tdatacompany_address[".arrKeyFields"][] = "id";

// use datepicker for search panel
$tdatacompany_address[".isUseCalendarForSearch"] = false;

// use timepicker for search panel
$tdatacompany_address[".isUseTimeForSearch"] = false;

$tdatacompany_address[".isUseiBox"] = false;



$tdatacompany_address[".isUseInlineAdd"] = true;

$tdatacompany_address[".isUseInlineEdit"] = true;
$tdatacompany_address[".isUseInlineJs"] = $tdatacompany_address[".isUseInlineAdd"] || $tdatacompany_address[".isUseInlineEdit"];

$tdatacompany_address[".allSearchFields"] = array();

$tdatacompany_address[".globSearchFields"][] = "full_addr";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("full_addr", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "full_addr";	
}
$tdatacompany_address[".globSearchFields"][] = "other_addr";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("other_addr", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "other_addr";	
}
$tdatacompany_address[".globSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "id";	
}
$tdatacompany_address[".globSearchFields"][] = "company_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("company_id", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "company_id";	
}
$tdatacompany_address[".globSearchFields"][] = "address";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("address", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "address";	
}
$tdatacompany_address[".globSearchFields"][] = "city_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_id", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "city_id";	
}
$tdatacompany_address[".globSearchFields"][] = "port_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("port_id", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "port_id";	
}
$tdatacompany_address[".globSearchFields"][] = "phone1";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("phone1", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "phone1";	
}
$tdatacompany_address[".globSearchFields"][] = "phone2";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("phone2", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "phone2";	
}
$tdatacompany_address[".globSearchFields"][] = "fax1";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("fax1", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "fax1";	
}
$tdatacompany_address[".globSearchFields"][] = "fax2";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("fax2", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "fax2";	
}
$tdatacompany_address[".globSearchFields"][] = "email";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("email", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "email";	
}
$tdatacompany_address[".globSearchFields"][] = "website";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("website", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "website";	
}
$tdatacompany_address[".globSearchFields"][] = "primary";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("primary", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "primary";	
}
$tdatacompany_address[".globSearchFields"][] = "company_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("company_name", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "company_name";	
}
$tdatacompany_address[".globSearchFields"][] = "city_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_name", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "city_name";	
}
$tdatacompany_address[".globSearchFields"][] = "port_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("port_name", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "port_name";	
}
$tdatacompany_address[".globSearchFields"][] = "state_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_name", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "state_name";	
}
$tdatacompany_address[".globSearchFields"][] = "state_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_code", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "state_code";	
}
$tdatacompany_address[".globSearchFields"][] = "city_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_code", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "city_code";	
}
$tdatacompany_address[".globSearchFields"][] = "country_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_code", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "country_code";	
}
$tdatacompany_address[".globSearchFields"][] = "country_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_name", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "country_name";	
}
$tdatacompany_address[".globSearchFields"][] = "pin_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("pin_code", $tdatacompany_address[".allSearchFields"]))
{
	$tdatacompany_address[".allSearchFields"][] = "pin_code";	
}


$tdatacompany_address[".googleLikeFields"][] = "full_addr";
$tdatacompany_address[".googleLikeFields"][] = "other_addr";
$tdatacompany_address[".googleLikeFields"][] = "id";
$tdatacompany_address[".googleLikeFields"][] = "company_id";
$tdatacompany_address[".googleLikeFields"][] = "address";
$tdatacompany_address[".googleLikeFields"][] = "city_id";
$tdatacompany_address[".googleLikeFields"][] = "port_id";
$tdatacompany_address[".googleLikeFields"][] = "phone1";
$tdatacompany_address[".googleLikeFields"][] = "phone2";
$tdatacompany_address[".googleLikeFields"][] = "fax1";
$tdatacompany_address[".googleLikeFields"][] = "fax2";
$tdatacompany_address[".googleLikeFields"][] = "email";
$tdatacompany_address[".googleLikeFields"][] = "website";
$tdatacompany_address[".googleLikeFields"][] = "primary";
$tdatacompany_address[".googleLikeFields"][] = "company_name";
$tdatacompany_address[".googleLikeFields"][] = "city_name";
$tdatacompany_address[".googleLikeFields"][] = "port_name";
$tdatacompany_address[".googleLikeFields"][] = "state_name";
$tdatacompany_address[".googleLikeFields"][] = "state_code";
$tdatacompany_address[".googleLikeFields"][] = "city_code";
$tdatacompany_address[".googleLikeFields"][] = "country_code";
$tdatacompany_address[".googleLikeFields"][] = "country_name";
$tdatacompany_address[".googleLikeFields"][] = "pin_code";



$tdatacompany_address[".advSearchFields"][] = "full_addr";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("full_addr", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "full_addr";	
}
$tdatacompany_address[".advSearchFields"][] = "other_addr";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("other_addr", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "other_addr";	
}
$tdatacompany_address[".advSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "id";	
}
$tdatacompany_address[".advSearchFields"][] = "company_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("company_id", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "company_id";	
}
$tdatacompany_address[".advSearchFields"][] = "address";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("address", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "address";	
}
$tdatacompany_address[".advSearchFields"][] = "city_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_id", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "city_id";	
}
$tdatacompany_address[".advSearchFields"][] = "port_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("port_id", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "port_id";	
}
$tdatacompany_address[".advSearchFields"][] = "phone1";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("phone1", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "phone1";	
}
$tdatacompany_address[".advSearchFields"][] = "phone2";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("phone2", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "phone2";	
}
$tdatacompany_address[".advSearchFields"][] = "fax1";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("fax1", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "fax1";	
}
$tdatacompany_address[".advSearchFields"][] = "fax2";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("fax2", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "fax2";	
}
$tdatacompany_address[".advSearchFields"][] = "email";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("email", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "email";	
}
$tdatacompany_address[".advSearchFields"][] = "website";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("website", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "website";	
}
$tdatacompany_address[".advSearchFields"][] = "primary";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("primary", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "primary";	
}
$tdatacompany_address[".advSearchFields"][] = "company_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("company_name", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "company_name";	
}
$tdatacompany_address[".advSearchFields"][] = "city_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_name", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "city_name";	
}
$tdatacompany_address[".advSearchFields"][] = "port_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("port_name", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "port_name";	
}
$tdatacompany_address[".advSearchFields"][] = "state_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_name", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "state_name";	
}
$tdatacompany_address[".advSearchFields"][] = "state_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_code", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "state_code";	
}
$tdatacompany_address[".advSearchFields"][] = "city_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("city_code", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "city_code";	
}
$tdatacompany_address[".advSearchFields"][] = "country_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_code", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "country_code";	
}
$tdatacompany_address[".advSearchFields"][] = "country_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_name", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "country_name";	
}
$tdatacompany_address[".advSearchFields"][] = "pin_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("pin_code", $tdatacompany_address[".allSearchFields"])) 
{
	$tdatacompany_address[".allSearchFields"][] = "pin_code";	
}

$tdatacompany_address[".isTableType"] = "list";


	

$tdatacompany_address[".isDisplayLoading"] = true;

$tdatacompany_address[".isResizeColumns"] = true;





$tdatacompany_address[".pageSize"] = 20;

$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdatacompany_address[".strOrderBy"] = $gstrOrderBy;
	
$tdatacompany_address[".orderindexes"] = array();

$tdatacompany_address[".sqlHead"] = "SELECT concat(contacts.company_name, '', contacts.address, '', cities.city_name, '', states.state_name, countries.country_name, pin_code) AS full_addr,  concat(contacts.phone1, '', contacts.phone2, '', contacts.email, '', contacts.website) AS other_addr,  contacts.id,  contacts.company_id,  contacts.address,  contacts.city_id,  contacts.port_id,  contacts.phone1,  contacts.phone2,  contacts.fax1,  contacts.fax2,  contacts.email,  contacts.website,  contacts.`primary`,  contacts.company_name,  cities.city_name,  ports.port_name,  states.state_name,  states.state_code,  cities.city_code,  countries.country_code,  countries.country_name,  contacts.pin_code";
$tdatacompany_address[".sqlFrom"] = "FROM contacts  INNER JOIN cities ON contacts.city_id = cities.id  INNER JOIN ports ON cities.id = ports.city_id AND contacts.port_id = ports.id  INNER JOIN states ON cities.state_id = states.id  INNER JOIN countries ON states.country_id = countries.id";
$tdatacompany_address[".sqlWhereExpr"] = "";
$tdatacompany_address[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatacompany_address[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatacompany_address[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tableKeys[] = "id";
	$tdatacompany_address[".Keys"] = $tableKeys;

//	full_addr
	$fdata = array();
	$fdata["strName"] = "full_addr";
	$fdata["ownerTable"] = "";
		$fdata["Label"]="Full Addr"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "full_addr";
	
		$fdata["FullName"]= "concat(contacts.company_name, '', contacts.address, '', cities.city_name, '', states.state_name, countries.country_name, pin_code)";
	
		
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["full_addr"]=$fdata;
//	other_addr
	$fdata = array();
	$fdata["strName"] = "other_addr";
	$fdata["ownerTable"] = "";
		$fdata["Label"]="Other Addr"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "other_addr";
	
		$fdata["FullName"]= "concat(contacts.phone1, '', contacts.phone2, '', contacts.email, '', contacts.website)";
	
		
		
		
		
		
				$fdata["Index"]= 2;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["other_addr"]=$fdata;
//	id
	$fdata = array();
	$fdata["strName"] = "id";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Id"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "id";
	
		$fdata["FullName"]= "contacts.id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 3;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		
		
		
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["id"]=$fdata;
//	company_id
	$fdata = array();
	$fdata["strName"] = "company_id";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Company"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="id";
	$fdata["LinkFieldType"]=3;
	$fdata["DisplayField"]="company_name";
				$fdata["LookupTable"]="companies";
	$fdata["LookupOrderBy"]="";
																$fdata["AllowToAdd"]=true; 
				
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "company_id";
	
		$fdata["FullName"]= "contacts.company_id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 4;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["company_id"]=$fdata;
//	address
	$fdata = array();
	$fdata["strName"] = "address";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Address"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text area";
	$fdata["ViewFormat"]= "HTML";
	
		
		
		
		
		
	$fdata["GoodName"]= "address";
	
		$fdata["FullName"]= "contacts.address";
	
		$fdata["IsRequired"]=true; 
	
		$fdata["UseRTE"]=true; 
	
		$fdata["UseRTEBasic"] = true; 
	
		
		
				$fdata["Index"]= 5;
			$fdata["EditParams"] = "";
			$fdata["EditParams"].= " rows=100";
		$fdata["nRows"] = 100;
			$fdata["EditParams"].= " cols=200";
		$fdata["nCols"] = 200;
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["address"]=$fdata;
//	city_id
	$fdata = array();
	$fdata["strName"] = "city_id";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="City "; 
	
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="id";
	$fdata["LinkFieldType"]=3;
	$fdata["DisplayField"]="city_name";
				$fdata["LookupTable"]="cities";
	$fdata["LookupOrderBy"]="city_name";
										$fdata["UseCategory"]=true; 
	$fdata["CategoryControl"]="port_id"; 
	$fdata["CategoryFilter"]=""; 
							$fdata["AllowToAdd"]=true; 
				
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "city_id";
	
		$fdata["FullName"]= "contacts.city_id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 6;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["city_id"]=$fdata;
//	port_id
	$fdata = array();
	$fdata["strName"] = "port_id";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Port "; 
	
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="id";
	$fdata["LinkFieldType"]=3;
	$fdata["DisplayField"]="port_name";
				$fdata["LookupTable"]="ports";
	$fdata["LookupOrderBy"]="port_name";
																$fdata["AllowToAdd"]=true; 
				
				//	dependent dropdowns	
	$fdata["DependentLookups"]=array();
	$fdata["DependentLookups"][]="city_id";
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "port_id";
	
		$fdata["FullName"]= "contacts.port_id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 7;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["port_id"]=$fdata;
//	phone1
	$fdata = array();
	$fdata["strName"] = "phone1";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Phone 1"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "phone1";
	
		$fdata["FullName"]= "contacts.phone1";
	
		
		
		
		
		
				$fdata["Index"]= 8;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=20";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["phone1"]=$fdata;
//	phone2
	$fdata = array();
	$fdata["strName"] = "phone2";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Phone 2"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "phone2";
	
		$fdata["FullName"]= "contacts.phone2";
	
		
		
		
		
		
				$fdata["Index"]= 9;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=20";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["phone2"]=$fdata;
//	fax1
	$fdata = array();
	$fdata["strName"] = "fax1";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Fax 1"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "fax1";
	
		$fdata["FullName"]= "contacts.fax1";
	
		
		
		
		
		
				$fdata["Index"]= 10;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=20";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["fax1"]=$fdata;
//	fax2
	$fdata = array();
	$fdata["strName"] = "fax2";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Fax 2"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "fax2";
	
		$fdata["FullName"]= "contacts.fax2";
	
		
		
		
		
		
				$fdata["Index"]= 11;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=20";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["fax2"]=$fdata;
//	email
	$fdata = array();
	$fdata["strName"] = "email";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Email"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "email";
	
		$fdata["FullName"]= "contacts.email";
	
		
		
		
		
		
				$fdata["Index"]= 12;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=250";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Email");	
						
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["email"]=$fdata;
//	website
	$fdata = array();
	$fdata["strName"] = "website";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Website"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "website";
	
		$fdata["FullName"]= "contacts.website";
	
		
		
		
		
		
				$fdata["Index"]= 13;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=250";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["website"]=$fdata;
//	primary
	$fdata = array();
	$fdata["strName"] = "primary";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Primary"; 
	
		
		
	$fdata["FieldType"]= 16;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Checkbox";
	$fdata["ViewFormat"]= "Checkbox";
	
		
		
		
		
		
	$fdata["GoodName"]= "primary";
	
		$fdata["FullName"]= "contacts.`primary`";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 14;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["primary"]=$fdata;
//	company_name
	$fdata = array();
	$fdata["strName"] = "company_name";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Company Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "company_name";
	
		$fdata["FullName"]= "contacts.company_name";
	
		
		
		
		
		
				$fdata["Index"]= 15;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["company_name"]=$fdata;
//	city_name
	$fdata = array();
	$fdata["strName"] = "city_name";
	$fdata["ownerTable"] = "cities";
		$fdata["Label"]="City Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "city_name";
	
		$fdata["FullName"]= "cities.city_name";
	
		
		
		
		
		
				$fdata["Index"]= 16;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["city_name"]=$fdata;
//	port_name
	$fdata = array();
	$fdata["strName"] = "port_name";
	$fdata["ownerTable"] = "ports";
		$fdata["Label"]="Port Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "port_name";
	
		$fdata["FullName"]= "ports.port_name";
	
		
		
		
		
		
				$fdata["Index"]= 17;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["port_name"]=$fdata;
//	state_name
	$fdata = array();
	$fdata["strName"] = "state_name";
	$fdata["ownerTable"] = "states";
		$fdata["Label"]="State Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "state_name";
	
		$fdata["FullName"]= "states.state_name";
	
		
		
		
		
		
				$fdata["Index"]= 18;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["state_name"]=$fdata;
//	state_code
	$fdata = array();
	$fdata["strName"] = "state_code";
	$fdata["ownerTable"] = "states";
		$fdata["Label"]="State Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "state_code";
	
		$fdata["FullName"]= "states.state_code";
	
		
		
		
		
		
				$fdata["Index"]= 19;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["state_code"]=$fdata;
//	city_code
	$fdata = array();
	$fdata["strName"] = "city_code";
	$fdata["ownerTable"] = "cities";
		$fdata["Label"]="City Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "city_code";
	
		$fdata["FullName"]= "cities.city_code";
	
		
		
		
		
		
				$fdata["Index"]= 20;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["city_code"]=$fdata;
//	country_code
	$fdata = array();
	$fdata["strName"] = "country_code";
	$fdata["ownerTable"] = "countries";
		$fdata["Label"]="Country Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "country_code";
	
		$fdata["FullName"]= "countries.country_code";
	
		
		
		
		
		
				$fdata["Index"]= 21;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["country_code"]=$fdata;
//	country_name
	$fdata = array();
	$fdata["strName"] = "country_name";
	$fdata["ownerTable"] = "countries";
		$fdata["Label"]="Country Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "country_name";
	
		$fdata["FullName"]= "countries.country_name";
	
		
		
		
		
		
				$fdata["Index"]= 22;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		$fdata["bInlineAdd"]=true; 
	
		
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["country_name"]=$fdata;
//	pin_code
	$fdata = array();
	$fdata["strName"] = "pin_code";
	$fdata["ownerTable"] = "contacts";
		$fdata["Label"]="Pin Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "pin_code";
	
		$fdata["FullName"]= "contacts.pin_code";
	
		
		
		
		
		
				$fdata["Index"]= 23;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatacompany_address["pin_code"]=$fdata;

	
$tables_data["company_address"]=&$tdatacompany_address;
$field_labels["company_address"] = &$fieldLabelscompany_address;
$fieldToolTips["company_address"] = &$fieldToolTipscompany_address;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["company_address"] = array();

	
// tables which are master tables for current table (detail)
$masterTablesData["company_address"] = array();

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "concat(contacts.company_name, '', contacts.address, '', cities.city_name, '', states.state_name, countries.country_name, pin_code) AS full_addr,  concat(contacts.phone1, '', contacts.phone2, '', contacts.email, '', contacts.website) AS other_addr,  contacts.id,  contacts.company_id,  contacts.address,  contacts.city_id,  contacts.port_id,  contacts.phone1,  contacts.phone2,  contacts.fax1,  contacts.fax2,  contacts.email,  contacts.website,  contacts.`primary`,  contacts.company_name,  cities.city_name,  ports.port_name,  states.state_name,  states.state_code,  cities.city_code,  countries.country_code,  countries.country_name,  contacts.pin_code";
$proto0["m_strFrom"] = "FROM contacts  INNER JOIN cities ON contacts.city_id = cities.id  INNER JOIN ports ON cities.id = ports.city_id AND contacts.port_id = ports.id  INNER JOIN states ON cities.state_id = states.id  INNER JOIN countries ON states.country_id = countries.id";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
$proto0["m_strTail"] = "";
$proto1=array();
$proto1["m_sql"] = "";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto1["m_column"]=$obj;
$proto1["m_contained"] = array();
$proto1["m_strCase"] = "";
$proto1["m_havingmode"] = "0";
$proto1["m_inBrackets"] = "0";
$proto1["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto1);

$proto0["m_where"] = $obj;
$proto3=array();
$proto3["m_sql"] = "";
$proto3["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto3["m_column"]=$obj;
$proto3["m_contained"] = array();
$proto3["m_strCase"] = "";
$proto3["m_havingmode"] = "0";
$proto3["m_inBrackets"] = "0";
$proto3["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto3);

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto5=array();
			$proto6=array();
$proto6["m_functiontype"] = "SQLF_CUSTOM";
$proto6["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "contacts.company_name"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "''"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "contacts.address"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "''"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "cities.city_name"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "''"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "states.state_name"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "countries.country_name"
));

$proto6["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "pin_code"
));

$proto6["m_arguments"][]=$obj;
$proto6["m_strFunctionName"] = "concat";
$obj = new SQLFunctionCall($proto6);

$proto5["m_expr"]=$obj;
$proto5["m_alias"] = "full_addr";
$obj = new SQLFieldListItem($proto5);

$proto0["m_fieldlist"][]=$obj;
						$proto16=array();
			$proto17=array();
$proto17["m_functiontype"] = "SQLF_CUSTOM";
$proto17["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "contacts.phone1"
));

$proto17["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "''"
));

$proto17["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "contacts.phone2"
));

$proto17["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "''"
));

$proto17["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "contacts.email"
));

$proto17["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "''"
));

$proto17["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "contacts.website"
));

$proto17["m_arguments"][]=$obj;
$proto17["m_strFunctionName"] = "concat";
$obj = new SQLFunctionCall($proto17);

$proto16["m_expr"]=$obj;
$proto16["m_alias"] = "other_addr";
$obj = new SQLFieldListItem($proto16);

$proto0["m_fieldlist"][]=$obj;
						$proto25=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "contacts"
));

$proto25["m_expr"]=$obj;
$proto25["m_alias"] = "";
$obj = new SQLFieldListItem($proto25);

$proto0["m_fieldlist"][]=$obj;
						$proto27=array();
			$obj = new SQLField(array(
	"m_strName" => "company_id",
	"m_strTable" => "contacts"
));

$proto27["m_expr"]=$obj;
$proto27["m_alias"] = "";
$obj = new SQLFieldListItem($proto27);

$proto0["m_fieldlist"][]=$obj;
						$proto29=array();
			$obj = new SQLField(array(
	"m_strName" => "address",
	"m_strTable" => "contacts"
));

$proto29["m_expr"]=$obj;
$proto29["m_alias"] = "";
$obj = new SQLFieldListItem($proto29);

$proto0["m_fieldlist"][]=$obj;
						$proto31=array();
			$obj = new SQLField(array(
	"m_strName" => "city_id",
	"m_strTable" => "contacts"
));

$proto31["m_expr"]=$obj;
$proto31["m_alias"] = "";
$obj = new SQLFieldListItem($proto31);

$proto0["m_fieldlist"][]=$obj;
						$proto33=array();
			$obj = new SQLField(array(
	"m_strName" => "port_id",
	"m_strTable" => "contacts"
));

$proto33["m_expr"]=$obj;
$proto33["m_alias"] = "";
$obj = new SQLFieldListItem($proto33);

$proto0["m_fieldlist"][]=$obj;
						$proto35=array();
			$obj = new SQLField(array(
	"m_strName" => "phone1",
	"m_strTable" => "contacts"
));

$proto35["m_expr"]=$obj;
$proto35["m_alias"] = "";
$obj = new SQLFieldListItem($proto35);

$proto0["m_fieldlist"][]=$obj;
						$proto37=array();
			$obj = new SQLField(array(
	"m_strName" => "phone2",
	"m_strTable" => "contacts"
));

$proto37["m_expr"]=$obj;
$proto37["m_alias"] = "";
$obj = new SQLFieldListItem($proto37);

$proto0["m_fieldlist"][]=$obj;
						$proto39=array();
			$obj = new SQLField(array(
	"m_strName" => "fax1",
	"m_strTable" => "contacts"
));

$proto39["m_expr"]=$obj;
$proto39["m_alias"] = "";
$obj = new SQLFieldListItem($proto39);

$proto0["m_fieldlist"][]=$obj;
						$proto41=array();
			$obj = new SQLField(array(
	"m_strName" => "fax2",
	"m_strTable" => "contacts"
));

$proto41["m_expr"]=$obj;
$proto41["m_alias"] = "";
$obj = new SQLFieldListItem($proto41);

$proto0["m_fieldlist"][]=$obj;
						$proto43=array();
			$obj = new SQLField(array(
	"m_strName" => "email",
	"m_strTable" => "contacts"
));

$proto43["m_expr"]=$obj;
$proto43["m_alias"] = "";
$obj = new SQLFieldListItem($proto43);

$proto0["m_fieldlist"][]=$obj;
						$proto45=array();
			$obj = new SQLField(array(
	"m_strName" => "website",
	"m_strTable" => "contacts"
));

$proto45["m_expr"]=$obj;
$proto45["m_alias"] = "";
$obj = new SQLFieldListItem($proto45);

$proto0["m_fieldlist"][]=$obj;
						$proto47=array();
			$obj = new SQLField(array(
	"m_strName" => "primary",
	"m_strTable" => "contacts"
));

$proto47["m_expr"]=$obj;
$proto47["m_alias"] = "";
$obj = new SQLFieldListItem($proto47);

$proto0["m_fieldlist"][]=$obj;
						$proto49=array();
			$obj = new SQLField(array(
	"m_strName" => "company_name",
	"m_strTable" => "contacts"
));

$proto49["m_expr"]=$obj;
$proto49["m_alias"] = "";
$obj = new SQLFieldListItem($proto49);

$proto0["m_fieldlist"][]=$obj;
						$proto51=array();
			$obj = new SQLField(array(
	"m_strName" => "city_name",
	"m_strTable" => "cities"
));

$proto51["m_expr"]=$obj;
$proto51["m_alias"] = "";
$obj = new SQLFieldListItem($proto51);

$proto0["m_fieldlist"][]=$obj;
						$proto53=array();
			$obj = new SQLField(array(
	"m_strName" => "port_name",
	"m_strTable" => "ports"
));

$proto53["m_expr"]=$obj;
$proto53["m_alias"] = "";
$obj = new SQLFieldListItem($proto53);

$proto0["m_fieldlist"][]=$obj;
						$proto55=array();
			$obj = new SQLField(array(
	"m_strName" => "state_name",
	"m_strTable" => "states"
));

$proto55["m_expr"]=$obj;
$proto55["m_alias"] = "";
$obj = new SQLFieldListItem($proto55);

$proto0["m_fieldlist"][]=$obj;
						$proto57=array();
			$obj = new SQLField(array(
	"m_strName" => "state_code",
	"m_strTable" => "states"
));

$proto57["m_expr"]=$obj;
$proto57["m_alias"] = "";
$obj = new SQLFieldListItem($proto57);

$proto0["m_fieldlist"][]=$obj;
						$proto59=array();
			$obj = new SQLField(array(
	"m_strName" => "city_code",
	"m_strTable" => "cities"
));

$proto59["m_expr"]=$obj;
$proto59["m_alias"] = "";
$obj = new SQLFieldListItem($proto59);

$proto0["m_fieldlist"][]=$obj;
						$proto61=array();
			$obj = new SQLField(array(
	"m_strName" => "country_code",
	"m_strTable" => "countries"
));

$proto61["m_expr"]=$obj;
$proto61["m_alias"] = "";
$obj = new SQLFieldListItem($proto61);

$proto0["m_fieldlist"][]=$obj;
						$proto63=array();
			$obj = new SQLField(array(
	"m_strName" => "country_name",
	"m_strTable" => "countries"
));

$proto63["m_expr"]=$obj;
$proto63["m_alias"] = "";
$obj = new SQLFieldListItem($proto63);

$proto0["m_fieldlist"][]=$obj;
						$proto65=array();
			$obj = new SQLField(array(
	"m_strName" => "pin_code",
	"m_strTable" => "contacts"
));

$proto65["m_expr"]=$obj;
$proto65["m_alias"] = "";
$obj = new SQLFieldListItem($proto65);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto67=array();
$proto67["m_link"] = "SQLL_MAIN";
			$proto68=array();
$proto68["m_strName"] = "contacts";
$proto68["m_columns"] = array();
$proto68["m_columns"][] = "id";
$proto68["m_columns"][] = "company_id";
$proto68["m_columns"][] = "address";
$proto68["m_columns"][] = "city_id";
$proto68["m_columns"][] = "port_id";
$proto68["m_columns"][] = "phone1";
$proto68["m_columns"][] = "phone2";
$proto68["m_columns"][] = "fax1";
$proto68["m_columns"][] = "fax2";
$proto68["m_columns"][] = "email";
$proto68["m_columns"][] = "website";
$proto68["m_columns"][] = "primary";
$proto68["m_columns"][] = "company_name";
$proto68["m_columns"][] = "pin_code";
$obj = new SQLTable($proto68);

$proto67["m_table"] = $obj;
$proto67["m_alias"] = "";
$proto69=array();
$proto69["m_sql"] = "";
$proto69["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto69["m_column"]=$obj;
$proto69["m_contained"] = array();
$proto69["m_strCase"] = "";
$proto69["m_havingmode"] = "0";
$proto69["m_inBrackets"] = "0";
$proto69["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto69);

$proto67["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto67);

$proto0["m_fromlist"][]=$obj;
												$proto71=array();
$proto71["m_link"] = "SQLL_INNERJOIN";
			$proto72=array();
$proto72["m_strName"] = "cities";
$proto72["m_columns"] = array();
$proto72["m_columns"][] = "id";
$proto72["m_columns"][] = "city_code";
$proto72["m_columns"][] = "city_name";
$proto72["m_columns"][] = "state_id";
$obj = new SQLTable($proto72);

$proto71["m_table"] = $obj;
$proto71["m_alias"] = "";
$proto73=array();
$proto73["m_sql"] = "contacts.city_id = cities.id";
$proto73["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "city_id",
	"m_strTable" => "contacts"
));

$proto73["m_column"]=$obj;
$proto73["m_contained"] = array();
$proto73["m_strCase"] = "= cities.id";
$proto73["m_havingmode"] = "0";
$proto73["m_inBrackets"] = "0";
$proto73["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto73);

$proto71["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto71);

$proto0["m_fromlist"][]=$obj;
												$proto75=array();
$proto75["m_link"] = "SQLL_INNERJOIN";
			$proto76=array();
$proto76["m_strName"] = "ports";
$proto76["m_columns"] = array();
$proto76["m_columns"][] = "id";
$proto76["m_columns"][] = "port_name";
$proto76["m_columns"][] = "city_id";
$obj = new SQLTable($proto76);

$proto75["m_table"] = $obj;
$proto75["m_alias"] = "";
$proto77=array();
$proto77["m_sql"] = "cities.id = ports.city_id AND contacts.port_id = ports.id";
$proto77["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "cities.id = ports.city_id AND contacts.port_id = ports.id"
));

$proto77["m_column"]=$obj;
$proto77["m_contained"] = array();
						$proto79=array();
$proto79["m_sql"] = "cities.id = ports.city_id";
$proto79["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "cities"
));

$proto79["m_column"]=$obj;
$proto79["m_contained"] = array();
$proto79["m_strCase"] = "= ports.city_id";
$proto79["m_havingmode"] = "0";
$proto79["m_inBrackets"] = "0";
$proto79["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto79);

			$proto77["m_contained"][]=$obj;
						$proto81=array();
$proto81["m_sql"] = "contacts.port_id = ports.id";
$proto81["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "port_id",
	"m_strTable" => "contacts"
));

$proto81["m_column"]=$obj;
$proto81["m_contained"] = array();
$proto81["m_strCase"] = "= ports.id";
$proto81["m_havingmode"] = "0";
$proto81["m_inBrackets"] = "0";
$proto81["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto81);

			$proto77["m_contained"][]=$obj;
$proto77["m_strCase"] = "";
$proto77["m_havingmode"] = "0";
$proto77["m_inBrackets"] = "0";
$proto77["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto77);

$proto75["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto75);

$proto0["m_fromlist"][]=$obj;
												$proto83=array();
$proto83["m_link"] = "SQLL_INNERJOIN";
			$proto84=array();
$proto84["m_strName"] = "states";
$proto84["m_columns"] = array();
$proto84["m_columns"][] = "id";
$proto84["m_columns"][] = "state_code";
$proto84["m_columns"][] = "state_name";
$proto84["m_columns"][] = "country_id";
$obj = new SQLTable($proto84);

$proto83["m_table"] = $obj;
$proto83["m_alias"] = "";
$proto85=array();
$proto85["m_sql"] = "cities.state_id = states.id";
$proto85["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "state_id",
	"m_strTable" => "cities"
));

$proto85["m_column"]=$obj;
$proto85["m_contained"] = array();
$proto85["m_strCase"] = "= states.id";
$proto85["m_havingmode"] = "0";
$proto85["m_inBrackets"] = "0";
$proto85["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto85);

$proto83["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto83);

$proto0["m_fromlist"][]=$obj;
												$proto87=array();
$proto87["m_link"] = "SQLL_INNERJOIN";
			$proto88=array();
$proto88["m_strName"] = "countries";
$proto88["m_columns"] = array();
$proto88["m_columns"][] = "id";
$proto88["m_columns"][] = "country_code";
$proto88["m_columns"][] = "country_name";
$obj = new SQLTable($proto88);

$proto87["m_table"] = $obj;
$proto87["m_alias"] = "";
$proto89=array();
$proto89["m_sql"] = "states.country_id = countries.id";
$proto89["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "country_id",
	"m_strTable" => "states"
));

$proto89["m_column"]=$obj;
$proto89["m_contained"] = array();
$proto89["m_strCase"] = "= countries.id";
$proto89["m_havingmode"] = "0";
$proto89["m_inBrackets"] = "0";
$proto89["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto89);

$proto87["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto87);

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
$obj = new SQLQuery($proto0);

$queryData_company_address = $obj;
$tdatacompany_address[".sqlquery"] = $queryData_company_address;

$tableEvents["company_address"] = new eventsBase;

?>
